package com.sq.partner.manager.dao.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sq.partner.manager.dao.SaleConfigDao;
import com.sq.partner.manager.mybatis.model.SaleConfig;

	/**
 * 
 * @author men
 *
 */
@Repository
public class SaleConfigDaoImpl extends BaseDaoImpl implements SaleConfigDao {
		@Override
		public String queryNextAgentNo(String agentType) throws Exception {

			return (String) this.query("queryNextAgentNo", agentType);
		}

		@Override
		public boolean addSaleConfig(SaleConfig saleConfig) throws Exception {
			return this.add("insertSaleConfig", saleConfig);
		}

		@Override
		public Integer queryTotalByCriteria(Map<String, Object> map)
				throws Exception {
			return (Integer) this.query("queryTotalByCondition", map);
		}

		@Override
		public List<Map<String, Object>> queryListByCriteria(Map<String, Object> map)
				throws Exception {
			// TODO Auto-generated method stub
			return this.queryList("queryPageByCondition", map);
		}

		@Override
		public void delSaleConfig(SaleConfig saleConfig) throws Exception {
			this.delete("delSaleConfig", saleConfig.getAgentNo());
		}

		@Override
		public List<SaleConfig> searchSaleConfigsListByplanCode(
				Map<String, Object> maps) throws Exception {
			// TODO Auto-generated method stub
			return this.queryList("searchSaleConfigsListByplanCode", maps);
		}

		@Override
		public SaleConfig searchSaleConfigById(String agentNo) throws Exception {
			return (SaleConfig) this.query("searchSaleConfigByid", agentNo);
		}

		@Override
		public boolean updateSaleConfig(SaleConfig SaleConfig) throws Exception {
			return this.update("updateSaleConfig", SaleConfig);
		}
		public  List<Map<String, Object>> implSaleConfigs(
				Map<String, Object> maps) throws Exception{
			return this.queryList("implSaleCoinFee", maps);
		}
}
